<?php
require_once("../db/db_connector.php");
require_once("../db/db_review.php");

// Database Access Begins ---------------------------------------- //
$con = get_db_con();
$review_list = get_review_list($con);
close_db_con();
// Database Access Ends ------------------------------------------ //

?>

<?php
include_once("../include/admin_header.php");
?>

<h2>Review</h2>
<a href="review_edit.php">Create Review</a>
<table>
	<tr>
		<th>id</th>
		<th>content</th>
		<th>date</th>
		<th>rating</th>
		<th>paradise_id</th>
		<th>user_id</th>
	</tr>
<?php foreach ($review_list as $review): ?>
	<tr>
		<td><?=$review["id"]?></td>
		<td><?=$review["content"]?></td>
		<td><?=$review["date"]?></td>
		<td><?=$review["rating"]?></td>
		<td><?=$review["paradise_id"]?></td>
		<td><?=$review["user_id"]?></td>
	</tr>
<?php endforeach ?>
</table>

<?php
include_once("../include/admin_footer.php");
?>
